﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Blog
{
    public class Themehandler : System.Web.UI.Page
    {
        public Themehandler()
        {
            PreInit += SetTheme;
        }

        protected void SetTheme(object sender, EventArgs e)
        {
            //Hvis brugeren har en cookie har den tidligere valgt et tema : aktivér det
            HttpCookie cookie = Request.Cookies["theme cookie"];

            if (cookie != null)
            {
                Page.Theme = cookie.Value;
            }
        }
    }
}